<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="header.jsp" %>
<html>
<head>
    <title>登录</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<div class="container">
    <div class="form-container">
        <h2>用户登录</h2>
        <form action="${pageContext.request.contextPath}/login" method="post">
            <div class="form-group">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            <div class="form-group">
                <label for="password">密码:</label>
                <input type="password" id="password" name="password" required>
            </div>
            <div class="form-group">
                <label>角色:</label>
                <select name="role" required>
                    <option value="系统管理员">系统管理员</option>
                    <option value="用户">用户</option>
                </select>
            </div>
            <div class="form-group">
                <button type="submit">登录</button>
            </div>
            <div class="form-footer">
                <p>还没有账号? <a href="${pageContext.request.contextPath}/jsp/register.jsp">立即注册</a></p>
            </div>
            <div class="error-message">${error}</div>
        </form>
    </div>
</div>
</body>
</html>